LearningSession.AbandonCurrentActivity Method

Stops the current activity by abandoning it without saving data and without further processing of navigation rules.

Parent Type: LearningSession

Namespace: Microsoft.LearningComponents

Assembly: Microsoft.LearningComponents.dll

Syntax
C#

public virtual void AbandonCurrentActivity ()

Exceptions
Exception type Condition
InvalidOperationException

Thrown if this method is called when there is no current activity in the session.

SequencingException

Thrown if the state of the session, such as the current sequencing rules, do not allow processing the requested navigation.

Remarks

Pending data model changes and other session changes that result from this method are not saved and should be persisted to long-term storage by calling CommitChanges after this method and prior to disposing the object.

In Scorm 2004 content: PostCondition rules are not run after the activity has been abandoned. Any current value of NavigationRequest.ExitMode of LearningDataModel.NavigationRequest will be ignored, and the AttemptStatus of the attempt on the activity will be set to Abandonded.

In Scorm 2004 content: Once this method is called, the current activity will no longer be active for this session. That is, CurrentActivityIsActive will be false. To continue the session, select an activity to attempt using one of the MoveToActivity methods.

In Scorm 1.2 and LRM content: Once this method is called, there will no longer be a current activity in the session.